home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
001-025
/
scopedisk8
/
superlib
/
libsrc
/
atoi.c
next >
Wrap
Text File
|
1995-03-18
|
334b
|
26 lines
/*
* atoi()
*
* Uses shiftsinsteadof multiplies.
*/
long
atoi(str)
register char *str;
{
register long i = 0;
register long neg =0;
while (*str== ' ')
++str;
if (*str =='-') {
++str;
neg = 1;
}
while (*str>= '0' && *str <= '9')
i = (i << 1) + (i << 3)+ *str++ - '0';
return ((int)((neg)?-i:i));
}